package com.hfjava.practice05;

import java.io.File;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: com.hfjava.practice05
 * @ClassName: FileAll
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/26 10:08
 * @Copyright 大牛版板所有
 */
public class FileAll {
    public static void main(String[] args) {
        File myFolder = new File("G:");
        File[] allFilePath = myFolder.listFiles();
        System.out.println("文件：");
        for (File file:allFilePath) {
            if (file.isFile()){
                System.out.println("\t"+file.getName());
            }
        }

        System.out.println("文件夹：");
        for (File file:allFilePath) {
            if (file.isDirectory()){
                System.out.println("\t"+file.getName());
            }
        }
    }
}
